package aiaudio.storage.api;

/**
 *
 * @author Nastya
 */
public class Tuple<Type1, Type2> {

    private Type1 first;
    private Type2 second;

    public Tuple(Type1 first, Type2 second) {
        this.first = first;
        this.second = second;
    }

    public Type1 getFirst() {
        return first;
    }

    public Type2 getSecond() {
        return second;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Tuple<Type1, Type2> other = (Tuple<Type1, Type2>) obj;
        if (this.first != other.first 
                && (this.first == null || !this.first.equals(other.first))) {
            return false;
        }
        if (this.second != other.second 
                && (this.second == null || !this.second.equals(other.second))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 29 * hash + (this.first != null ? this.first.hashCode() : 0);
        hash = 29 * hash + (this.second != null ? this.second.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return "Tuple{" + "first=" + first + ", second=" + second + '}';
    }
    
    @Override
    public Tuple<Type1, Type2> clone() {
        return new Tuple<Type1, Type2>(first, second);
    }

}
